package com.chenxin.interact.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.chenxin.interact.domain.wmsToMes.WmsToMesOverdue;
import com.chenxin.interact.mapper.WmsToMesOverdueMapper;
import com.chenxin.interact.service.IWmsToMesOverdueService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WmsToMesOverdueServiceImpl implements IWmsToMesOverdueService {
    @Autowired
    private WmsToMesOverdueMapper wmsToMesOverdueMapper;

    @Override
    public List<WmsToMesOverdue> selectWmsToMesOverdueList() {
        QueryWrapper<WmsToMesOverdue> wrapper = new QueryWrapper<>();
        wrapper.eq("status", 0).last("order by create_date");
        return wmsToMesOverdueMapper.selectList(wrapper);
    }

    @Override
    public WmsToMesOverdue selectWmsToMesOverdue() {
        QueryWrapper<WmsToMesOverdue> wrapper = new QueryWrapper<>();
        wrapper.eq("status", 0).last("limit 1");
        return wmsToMesOverdueMapper.selectOne(wrapper);
    }
}
